Bottle1 = Widget.extend({
	runningAction:null,
	ctor:function(){
		this._super();
		this.init();
		this.initAction();
		this.setTag(TAG_BOTTLE1_ALL);
	},
	init:function(){
		this.body = new Button(this, 10, TAG_BOTTLE1, "#action1/bottle1.png", this.callback,this);
		
		var lid=new Button(this,9,TAG_LID2,"#lid2.png",this.callback,this);
		lid.setPosition(cc.p(-this.body.width*0.03, this.body.height*0.35));
	},
	initAction:function(){
		var animFrames=[];
		for(var i=1;i<5;i++){
			var str="action1/bottle"+i+".png";
			var frame=cc.spriteFrameCache.getSpriteFrame(str);
			animFrames.push(frame);
		}
		var animation=new cc.Animation(animFrames,0.2)
		this.runningAction=cc.repeat(cc.animate(animation),1);
		this.runningAction.retain();
	},
	callback:function(p){
		var func=cc.callFunc(function() {
			gg.flow.next();
		},this);
		switch (p.getTag()) {
		case TAG_LID2:
			var ber=cc.bezierBy(1, [cc.p(10, 35),cc.p(50, 50),cc.p(70, -100)]);
			var rotate=cc.rotateBy(1,180);
			p.runAction(cc.sequence(cc.spawn(ber,rotate),func));
			break;
		case TAG_BOTTLE1:
			var ber=cc.bezierBy(1, [cc.p(-20, 50),cc.p(-150, 186),cc.p(-120,280)]);
			var rotate=cc.rotateBy(1,-85);
			var buret=ll.run.getChildByTag(TAG_BURET_ALL);
			var lid=this.getChildByTag(TAG_LID2);
			p.runAction(cc.sequence(cc.spawn(cc.sequence(ber,this.runningAction),cc.callFunc(function() {
				buret.rotateBody();
			},this)),cc.callFunc(function() {
				buret.upFilm();
			},this),cc.delayTime(1),cc.spawn(cc.sequence(this.runningAction.reverse(),ber.reverse()),cc.callFunc(function() {
				buret.rotateBack();
			}, this)),cc.callFunc(function() {
				p.setVisible(false);
				lid.setVisible(false);
			},this),func));
			break;
		default:
			break;
		}
	}
});